package com.algorithms;

import com.algorithms.parsers.LinkedPostfixParser;
import com.algorithms.parsers.PostfixParser;

public class test_parse_equation extends Thread {
	public void run(){
		//String postFix1 = PostfixParser.parseInfix("A+ (B *C -   D)");
		//System.out.println(postFix1);

		//String postFix2 = PostfixParser.parseInfix("A *(B   +  C)   - D/(E+ F)");
		//System.out.println(postFix2);

		//String postFix3 = PostfixParser.parseInfix("A + B *(C-(D + E))");
		//System.out.println(postFix3);

		//String postFix4 = PostfixParser.parseInfix("A + B*C -   D");
		//System.out.println(postFix4);

		//String postFix5 = PostfixParser.parseInfix("D + (A+(B* C +( D-  E  )) -  F)");
		//System.out.println(postFix5);
		
		//String postFix5 = PostfixParser.parseInfix("3 + (7+(2* 8 +( 3-  6  )) -  9)");
		//System.out.println(postFix5);
		//int sum = PostfixParser.evaluatePostfix(postFix5);
		//System.out.println("sum: " + sum);

		//int sum = PostfixParser.evaluatePostfix("345+*612+/-");
		//System.out.println("sum: " + sum);
		
		String postFix5 = LinkedPostfixParser.parseInfix("D + (A+(B* C +( D-  E  )) -  F)");
		System.out.println(postFix5);

		int sum = LinkedPostfixParser.evaluatePostfix("345+*612+/-");
		System.out.println("sum: " + sum);

	}
	
	
	
	public static void main(String args[]){
		new test_parse_equation().start();
	}
}
